%M=5
mu = linspace(-1,1,5);
sigma = 3*(mu(2)-mu(1));

X = linspace(-1, 1);
X = X';

phi5 = ones(size(X,1),6);
for x=1:size(X,1)
    phi5(x, 1) = 1;
    for j = 2:6
        phi5(x, j) = exp(-(X(x)-mu(j-1))^2 / 2*sigma^2);
    end
end
figure(241)
hold on;
plot(X, phi5(:, 1))
plot(X, phi5(:, 2))
plot(X, phi5(:, 3))
plot(X, phi5(:, 4))
plot(X, phi5(:, 5))
plot(X, phi5(:, 6))
hold off;

%M=10
mu = linspace(-1,1,10);
sigma = 3*(mu(2)-mu(1));

phi10 = ones(size(X,1),11);
for x=1:size(X,1)
    phi10(x, 1) = 1;
    for j = 2:11
        phi10(x, j) = exp(-(X(x)-mu(j-1))^2 / 2*sigma^2);
    end
end
figure(242);
hold on;
plot(X, phi10(:, 1))
plot(X, phi10(:, 2))
plot(X, phi10(:, 3))
plot(X, phi10(:, 4))
plot(X, phi10(:, 5))
plot(X, phi10(:, 6))
hold off;

%M=15
mu = linspace(-1,1,15);
sigma = 3*(mu(2)-mu(1));

phi15 = ones(size(X,1),1);
for x=1:size(X,1)
    phi15(x, 1) = 1;
    for j = 2:16
        phi15(x, j) = exp(-(X(x)-mu(j-1))^2 / 2*sigma^2);
    end
end
figure(243);
hold on;
plot(X, phi15(:, 1))
plot(X, phi15(:, 2))
plot(X, phi15(:, 3))
plot(X, phi15(:, 4))
plot(X, phi15(:, 5))
plot(X, phi15(:, 6))
hold off;

